C 固定格式要求严格：代码从第 7 列开始；第 1-6 列可用于标签等。
      PROGRAM Hello
      IMPLICIT NONE    ! 禁用隐式变量定义
      REAL :: X, Y        ! 显式声明 X 为 REAL 类型
      INTEGER :: I
      PRINT *, "Hello, Fortran 77!"
      X = 0.0
      Y = 1.0
      IF (X .GT. 0) PRINT *, "X is positive"

      IF (X .GT. 0) THEN
        PRINT *, "X is positive"
        ELSE
            PRINT *, "X is not positive"
        END IF

      IF (Y) 10, 20, 30
10      PRINT *, "Y is negative"
        GOTO 40
20      PRINT *, "Y is zero"
        GOTO 40
30      PRINT *, "Y is positive"
C 在 Fortran 中，GOTO 必须跳转到某个有效的代码行，CONTINUE 作为占位符满足这一要求。CONTINUE 不执行任何操作。它是一条空操作语句，仅用来满足语法和程序逻辑跳转的需要。
40      CONTINUE

      DO 100 I = 1, 5
        PRINT *, "I = ", I
100    CONTINUE

      I = 0
101   I = I + 1
      PRINT *, "I = ", I
      IF (I .GE. 5) GOTO 201
      GOTO 101
201   CONTINUE

      I = 0
      DO WHILE (I .LT. 5)
        PRINT *, "I = ", I
        I = I + 1
      END DO
      END